<template>
  <a-modal v-model="visible" :footer="null" :title="title" width="40%">
    <a-spin :spinning="confirmSpin">
      <a-form-model
        ref="form"
        :model="configData"
        :rules="rules"
        :label-col="labelCol"
        :wrapper-col="wrapperCol">

        <a-form-model-item label="huiFuId" prop="huiFuId">
          <a-input v-model="configData.huiFuId" placeholder="请输入 huiFuId" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="productId" prop="productId">
          <a-input v-model="configData.productId" placeholder="请输入 productId" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="rsaPrivateKey" prop="rsaPrivateKey">
          <a-input v-model="configData.rsaPrivateKey" placeholder="请输入 rsaPrivateKey" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="rsaPublicKey" prop="rsaPublicKey">
          <a-input v-model="configData.rsaPublicKey" placeholder="请输入 rsaPublicKey" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="sysId" prop="sysId">
          <a-input v-model="configData.sysId" placeholder="请输入 sysId" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

<!--        <a-form-model-item label="domain" prop="domain">-->
<!--          <a-input v-model="configData.domain" placeholder="请输入 domain" :style="disable?{color:'black'}:{}"-->
<!--                   :disabled="disable"/>-->
<!--        </a-form-model-item>-->

        <a-form-model-item :wrapper-col="{ span: 14, offset: 7 }" v-if="!disable">
          <a-button type="primary" style="width:100px;" @click="onSubmit">
            修改
          </a-button>
          <a-button style="margin-left: 20px;width:100px;" @click="resetForm">
            重置
          </a-button>
        </a-form-model-item>
      </a-form-model>
    </a-spin>
  </a-modal>
</template>
<script>
import {BoneCommonMixin} from "@/mixins/BoneCommonMixin";
import {ConfigDictMixins} from "@views/gospel/configCenter/mixins/ConfigDictMixins";

export default {
  name: "HuiFuPayModal",
  mixins: [BoneCommonMixin, ConfigDictMixins],
  data() {
    return {
      description: "汇付-APP 公众号 小程序通用",
      configData: {
        appId: "",
        appSecret: "",
        mchId: "",
        partnerKey: "",
        certPath: "",
        domain: "",
      },
      rules: {
        appId: [
          { required: true, message: '请输入 huiFuId', trigger: 'blur' },
        ],
        appSecret: [
          { required: true, message: '请输入 productId', trigger: 'blur' },
        ],
        mchId: [
          { required: true, message: '请输入 rsaPrivateKey', trigger: 'blur' },
        ],
        partnerKey: [
          { required: true, message: '请输入 rsaPublicKey', trigger: 'blur' },
        ],
        certPath: [
          { required: true, message: '请输入 sysId', trigger: 'blur' },
        ],
      },
      type: "huiFuPayConfig",
      title: "",
      url: {
        configUpdate: "",
      }
    }
  },
}
</script>

<style scoped>

</style>